package com.jingbit.ai.utils;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.seg.common.Term;

import java.util.List;

public class HanlpUtil {
    public static List<Term> segment(String inputText) {
        return HanLP.segment(inputText);
    }

    public static void main(String[] args) {
        List<Term> terms = HanLP.segment("北京天安门广场上的升旗仪式");
        for (Term term : terms) {
            System.out.println(term.word + '/' + term.nature);
        }
    }
}